// 笔记类型枚举
export enum NoteType {
  CODE = 'code',
  DIARY = 'diary',
  TODO = 'todo'
}

// 待办事项状态
export enum TodoStatus {
  PENDING = 'pending',
  IN_PROGRESS = 'in_progress',
  COMPLETED = 'completed'
}

// 待办事项分类
export interface TodoCategory {
  id: string;
  name: string;
  color: string;
  description?: string;
}

// 基础笔记接口
export interface BaseNote {
  id: string;
  title: string;
  content: string;
  type: NoteType;
  createdAt: Date;
  updatedAt: Date;
  tags: string[];
}

// 代码笔记
export interface CodeNote extends BaseNote {
  type: NoteType.CODE;
  language: string;
  code: string;
  description?: string;
}

// 日记笔记
export interface DiaryNote extends BaseNote {
  type: NoteType.DIARY;
}

// 待办事项
export interface TodoItem {
  id: string;
  title: string;
  description?: string;
  status: TodoStatus;
  category: string;
  priority: 'low' | 'medium' | 'high';
  dueDate?: Date;
  createdAt: Date;
  updatedAt: Date;
}

// 待办事项笔记
export interface TodoNote extends BaseNote {
  type: NoteType.TODO;
  todos: TodoItem[];
  category: string;
}

// 联合类型
export type Note = CodeNote | DiaryNote | TodoNote;

// 用于创建笔记的基础类型
export type CreateNoteData = {
  title: string;
  content: string;
  tags: string[];
  type: NoteType;
  // 代码笔记特有字段
  language?: string;
  code?: string;
  description?: string;
  // 日记特有字段 - 已简化，只需要标题和内容
  // 待办事项特有字段
  category?: string;
  todos?: TodoItem[];
};

// 应用状态
export interface AppState {
  notes: Note[];
  categories: TodoCategory[];
  currentNote: Note | null;
  isLoading: boolean;
  error: string | null;
}

// 腾讯云 COS 配置
export interface COSConfig {
  SecretId: string;
  SecretKey: string;
  Bucket: string;
  Region: string;
}

// 文件上传结果
export interface UploadResult {
  url: string;
  key: string;
  etag: string;
} 